/*
 * @Author: luqinghua
 * @Date: 2023-08-29 18:45:49
 * @LastEditors: luqinghua
 * @LastEditTime: 2024-06-17 08:33:28
 * @FilePath: \gic-webd:\DownLoad\7 my project\vite-vue3-template\src\router\index.ts
 * @Description:
 */
import { createRouter, type RouteRecordRaw, createWebHashHistory } from 'vue-router'
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'layout',
    component: () => import('@/views/layout/index.vue'),
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'home',
        meta: { icon: 'AppstoreOutlined', title: '首页', lock: true },
        component: () => import('@/views/home.vue')
      },
      {
        path: '/theme',
        name: 'theme',
        meta: { icon: 'AppstoreOutlined', title: '主题' },
        component: () => import('@/views/demo/theme/index.vue')
      },
      {
        path: '/promise',
        name: 'promise',
        meta: { icon: 'AppstoreOutlined', title: 'promise' },
        component: () => import('@/views/demo/JavaScript/promise.vue')
      },
      {
        path: 'dragNode',
        name: 'dragNode',
        meta: { icon: 'appstoreOutlined', title: 'dragNode' },
        component: () => import('@/views/demo/JavaScript/dragNode.vue')
      },
      {
        path: '/el-table',
        name: 'el-table',
        meta: { icon: 'AppstoreOutlined', title: 'el-table' },
        component: () => import('@/views/demo/el-table/index.vue')
      },
      {
        path: '/draggable',
        name: 'draggable',
        meta: { icon: 'AppstoreOutlined', title: 'draggable' },
        component: () => import('@/views/demo/draggable/index.vue')
      },
      {
        path: '/loading',
        name: 'loading',
        meta: { icon: 'AppstoreOutlined', title: 'loading' },
        component: () => import('@/views/demo/ant/loading.vue')
      },
      // {
      //   path: '/JavaScript',
      //   name: 'JavaScript',
      //   // component: () => import('@/views/layout/index.vue'),
      //   meta: { icon: 'AppstoreOutlined', title: 'newFun' },
      //   children: [
      //     {
      //       path: '/newFun',
      //       name: 'newFun',
      //       meta: { icon: 'AppstoreOutlined', title: 'newFun' },
      //       component: () => import('@/views/demo/JavaScript/newFun.vue')
      //     },
      //   ]
      // },
      {
        path: '/newFun',
        name: 'newFun',
        meta: { icon: 'AppstoreOutlined', title: 'newFun' },
        component: () => import('@/views/demo/JavaScript/newFun.vue')
      },
      {
        path: '/test',
        name: 'test',
        meta: { icon: 'AppstoreOutlined', title: 'CodeTest' },
        component: () => import('@/views/demo/test.vue')
      },
      {
        path: '/about',
        name: 'about',
        meta: { icon: 'AppstoreOutlined', title: '关于' },
        component: () => import('@/views/demo/about.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
